﻿#ifndef GY_GRAPHICSPOLYGONREGULAR_H
#define GY_GRAPHICSPOLYGONREGULAR_H

#include "Graphics/BasicGraphics/GY_BasicsGraphicsObject.h"
#include "Graphics/GY_Object.h"
#include "GY_ControlLibrary_global.h"
#include <QObject>
#include <QPointF>
#include <QtMath>
#include <QDebug>
#include <QPen>

class GY_CONTROLLIBRARY_EXPORT GY_GraphicsPolygonRegular : public GY_BasicsGraphicsObject
{
    Q_OBJECT
public:
    explicit Q_INVOKABLE GY_GraphicsPolygonRegular(const QString &guid,QGraphicsItem *parent = nullptr);
    explicit Q_INVOKABLE GY_GraphicsPolygonRegular(const QString &guid,
                                       const QPointF &centerPoint,
                                       const QPointF &firstPoint,
                                       const int &numberOfPoints,
                                       QGraphicsItem *parent = nullptr);
    ~GY_GraphicsPolygonRegular();
private:
    /**
     * @brief updateCenter 更新中心点坐标
     * @param name
     * @param value
     * @return
     */
    bool updateCenter(const QString &name,const QVariant &value);
    /**
     * @brief updatePoint 更新编辑点坐标
     * @param name
     * @param value
     * @return
     */
    bool updateFirstPoint(const QString &name,const QVariant &value);
    /**
     * @brief updateNumberOfPoints 更新正多边形顶点数量
     * @param name
     * @param value
     * @return
     */
    bool updateNumberOfPoints(const QString &name,const QVariant &value);//3-100
    /**
     * @brief updatePath 绘制正多边形
     */
    void updatePath();
    /**
     * @brief initializationPropertyInfo 初始化信息
     */
    void initializationPropertyInfo();
signals:

};

#endif // GY_GRAPHICSPOLYGONREGULAR_H
